package edu.localisationPhone;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

public class LocalisationPhoneActivity extends Activity {
	
	private Spinner spinner;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		
		this.spinner = (Spinner) findViewById(R.id.liste);
		
		ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
				this, R.array.listeTab, android.R.layout.simple_spinner_item);
		
		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		spinner.setAdapter(adapter);
		
	}
	
	public void clicBouton(View view) {
		
		if (view.getId() == R.id.bouton) {
			switch (this.spinner.getSelectedItemPosition()) {
			case 0:
				Intent myIntent = new Intent(this, SauveteurActivity.class);
				this.startActivity(myIntent);
				this.finish();
			}
		}
	}
}